<template>
  <div class="outer">
    <p>List</p>
    <button @click="sendFather">点我向父发数据</button>
  </div>
</template>

<script>
export default {
  //忽略Eslint警告  /*eslint-disable*/
  name: "List",
  data() {
    return {
      //一般我们在发布信息之前，需要一个初始值
      list: [
        {name:"xiaoli",age:18},
        {name:"xiaowang",age:16},
        {name:"xiaoB",age:33}
        ],
    };
  },
  methods: {
      sendFather(){
        this.$emit("com",this.list)
      }
  },
};
</script>

<style scoped>
.outer {
  height: 200px;
  margin: 30px;
  background: pink;
}
</style>